package com.wz.translate.util;

import java.util.EnumMap;
import java.util.Iterator;
import java.util.Set;
import com.wz.translate.automaton.bean.BaseBean;


public class TypeGetter<K extends Enum<K>> {
	public TypeGetter(){}
	public boolean patternBeanType(String patternString,BaseBean baseBean,EnumMap<K, String> map){
		Set<K> dataSet =(Set<K>) map.keySet();
		Iterator<K> iter = dataSet.iterator();
		boolean success = false;
		for(;iter.hasNext();){
			K d = iter.next();
			if (map.get(d).equals(patternString)){
				baseBean.setType(d);
				success = true;
			}
		}
		return success;
	}
}
